<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>资料认证</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<style type="text/css">
			#sfz_pic{position: relative;}/*opacity: 0;*/
			 .upload,.upload1{position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;}
			#dp_pic{position: relative;}
			 .upload2{position: absolute;top: 0;left: 0;width: 100%;height: 100%;opacity: 0;}
			#yyzz_pic{position: relative;}
			 .upload3{position: absolute;top: 5%;left: 6%;height: 100%;width: 100%;opacity: 0;}
			#qt_pic{position: relative;}
			 .upload4{position: absolute;top: 5%;left: 6%;height: 100%;width: 100%;opacity: 0;}
			
		</style>
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop">
						<span class="title">资料认证</span>
						{if  $account.is_verify==3}
						<span class="title" style="color: #FF0000;">驳回原因:{$account.reason}</span>
						{/if}
					</div>
					<div class="indrig_con renz_con">
						 <form class="mui-input-group gerenzl_group layui-form">
							<div class="shxx_item">
								<div class="shxx_title">认证基本信息</div>
								<div class="shxx_row clearfix">
						            <div class="left"><em>*</em>姓名</div>
						            <div class="right">
						                <div class="htrig_box">
						                	<div class="htrig_con">
						                		<input type="text"  name="user_name" value="{$account.user_name}" class="chax_input" placeholder="请输入真实姓名" lay-verify="required" autocomplete="off" class="layui-input">
						                	</div>
						                	<p class="redtip">姓名不能为空</p>
						                </div>
						            </div>
						        </div>
								<div class="shxx_row clearfix">
						            <div class="left"><em>*</em>身份证号</div>
						            <div class="right">
						                <div class="htrig_box">
						                	<div class="htrig_con">
						                		<input type="text" name="id_number" value="{$account.id_number}" class="chax_input" placeholder="请输入身份证号码" lay-verify="required" autocomplete="off" class="layui-input">
						                	</div>
						                	<p class="redtip">身份证号不能为空</p>
						                </div>
						                <p class="wztip" style="color: #FF0000;">请确认您的身份证号码填写无误，该身份证号必须与您上传的身份证照片一致</p>
						            </div>
						        </div>
						        <div class="shxx_row clearfix">
						            <div class="left"><em>*</em>开户行</div>
						            <div class="right">
						                <div class="htrig_box">
						                	<div class="htrig_con">
						                		<input type="text" name="bank_name" value="{$account.bank_name}" class="chax_input" placeholder="请输入开户行及分行,如XXXX银行XXXX支行" lay-verify="required" autocomplete="off" class="layui-input">
						                	</div>
						                	<p class="redtip">开户行不能为空</p>
						                </div>
						            </div>
						        </div>
						        <div class="shxx_row clearfix">
						            <div class="left"><em>*</em>银行卡号</div>
						            <div class="right">
						                <div class="htrig_box">
						                	<div class="htrig_con">
						                		<input type="text" name="bank_no" value="{$account.bank_no}" class="chax_input" placeholder="请输入银行卡号" lay-verify="required" autocomplete="off" class="layui-input">
						                	</div>
						                	<p class="redtip">银行卡号不能为空</p>
						                </div>
						            </div>
						        </div>
								<div class="shxx_row clearfix">
						            <div class="left"><em>*</em>预留手机号</div>
						            <div class="right">
						                <div class="htrig_box">
						                	<div class="htrig_con">
						                		<input type="text" name="reserve_mobile" value="{$account.reserve_mobile}" class="chax_input" placeholder="请输入开户行及分行" lay-verify="required" autocomplete="off" class="layui-input">
						                	</div>
						                	<p class="redtip">开户行不能为空</p>
						                </div>
						            </div>
						        </div>
							</div>
							<div class="shxx_item">
								<div class="shxx_title">证件影印件</div>
								<p class="renz_tip">请提交证件原件照片（证件如为复印件，请务必盖公章后再拍照上传），单个文件大小不能超过3M，格式支持.jpg.png</p>
								<ul class="renz_box clearfix">
						    		<li>
						    			<div class="renz_img" id="yyzz_pic" >	
						    				<input type="hidden" name="id_card_front" value="{$account.id_card_front}" id="thumb_1" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_1" class="upload1" value="选择图片文件" multiple />
						    				{if $account['id_card_front'] == null || $account['id_card_front'] ==""}
												<span><img class='img_1' id='img_1' src="__AGENT__/img/renz.jpg"></span>
											{else}
												<span><img class='img_1' id='img_1' src="{$account.id_card_front}"></span>
											{/if}
						    			</div>
						    			<div>上传身份证正面照片</div>
						    		</li>
						    		<li>
						    			<div class="renz_img " id="yyzz_pic" >
						    				<input type="hidden" name="id_card_behind" value="{$account.id_card_behind}" id="thumb_2" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_2" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$account.id_card_behind == null"}
												<span><img class='img_2' id='img_2' src="__AGENT__/img/renz2.jpg"></span>
											{else /}
												<span><img class='img_2' id='img_2' src="{$account.id_card_behind}"></span>
											{/if}
						    			</div>
						    			<div>上传身份证反面照片</div>
						    		</li>
						    		<li>
						    			<div class="renz_img " id="yyzz_pic" >
						    				<input type="hidden" name="half_photo" value="{$account.half_photo}" id="thumb_3" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_3" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$account.half_photo == null"}
												<span><img class='img_3' id='img_3' src="__AGENT__/img/renz3.jpg"></span>
											{else /}
												<span><img class='img_3' id='img_3' src="{$account.half_photo}"></span>
											{/if}
						    			</div>
						    			<div>上传个人半身手持身份证照片</div>
						    		</li>
						 			<li>
						    			<div class="renz_img " id="yyzz_pic" >	
						    				<input type="hidden" name="bank_card_front" id="thumb_4" value="{$account.bank_card_front}" lay-verify="required" autocomplete="off" class="layui-input"/>
						    				<input type="file" id="upload_4" class="upload1" value="选择图片文件" multiple />
						    				{if condition="$account.bank_card_front == null"}
												<span><img class='img_4' id='img_4' src="__AGENT__/img/renz4.jpg"></span>
											{else /}
												<span><img class='img_4' id='img_4' src="{$account.bank_card_front}"></span>
											{/if}
						    			</div>
						    			<div>上传银行卡正面照片</div>
						    		</li>
						    	</ul>
							</div>
							{if $account.is_verify==1}
								<button type="button" class="renz_btn" disabled="disabled" lay-submit >已通过</button>
							{elseif $account.is_verify==2}
								<button type="button" class="renz_btn" lay-submit >待审核</button>
							{else/}
								<button type="button" class="renz_btn"  lay-submit lay-filter="submit_from">提交</button>
							{/if}
						</form>						
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
	</body>

</html>
<script>
	//图片上传
	layui.use(['form','upload'], function(){
  		var $ = layui.jquery,upload = layui.upload,form = layui.form;
  		
  		var uploadInst_1 = upload.render({
			elem: '#upload_1'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_1').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('oem/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_1').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('oem/index/upload')}"
		    ,accept:'images'
		});
		
		var uploadInst_1 = upload.render({
			elem: '#upload_2'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_2').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('oem/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_2').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('oem/index/upload')}"
		    ,accept:'images'
		});
		
		var uploadInst_1 = upload.render({
			elem: '#upload_3'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_3').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('oem/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_3').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('oem/index/upload')}"
		    ,accept:'images'
		});
		
		var uploadInst_1 = upload.render({
			elem: '#upload_4'
		    ,auto: false //选择文件后不自动上传
		    ,choose: function(obj){
			    //将每次选择的文件追加到文件队列
			    var files = obj.pushFile();
			    //预读本地文件，如果是多文件，则会遍历。(不支持ie8/9)
			    obj.preview(function(index, file, result){
			    	$('#img_4').attr('src', result); //图片链接（base64）
			    	var sendData = result.substring(result.indexOf(";base64,")+8);
			    	$.post("{:url('oem/index/upload')}",{value:sendData},function(data){ 
	                            if(data.code == '200'){  
	                            	$('#thumb_4').val(data.url);
	                            }else{  
	                                layer.msg(data.msg);
	                            }  
                    		});
			    });
			}
		    ,url: "{:url('oem/index/upload')}"
		    ,accept:'images'
		});
		
		//监听表单提交
		form.on('submit(submit_from)', function(data){
			var a = data.field;
			tijiao();
  			return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
		});
		
	})
	
	//提交表单
	function tijiao(){
  		 $.ajax({
             	type:"post",
                url:"{:url('index/renzheng')}",
                data: $('.layui-form').serialize(),//表单数据
                success:function(data){
                    if(data.code==200){
                    	layer.msg('成功', {
						  icon: 1,
						  time: 1500 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
							window.parent.location.reload();
							var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
					       	parent.layer.close(index); 
						});
                    }else{
                    	layer.msg('失败！');//保存成功提示
                    }
                },error:function(data){
                	var a = data;
                }
        });
  		
  	}
</script>
